#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

#define ROW 3
#define COL 3

typedef struct pos
{
	int x;
	int y;
}pos;

pos find_num(int arr[ROW][COL], int k)
{
	int x = 0;
	int y = COL - 1;
	pos p = { -1,-1 };

	while (x <= ROW - 1 && y >= 0)
	{
		if (k < arr[x][y])
		{
			y--;
		}
		else if (k > arr[x][y])
		{
			x++;
		}
		else
		{
			p.x = x;
			p.y = y;
			return p;
		}
	}
	return p;
}


int main()
{
	int arr[ROW][COL] = { 2,3,4,5,6,8,7,12,13 };

	int k = 0;
	scanf("%d", &k);

	pos ret = find_num(arr, k);
	printf("%d , %d\n", ret.x, ret.y);
	return 0;
}